use "$data_out/provider_propensity.dta", clear


//doctor shopping distribution of results

forval i = 4/7 {
cap gen numprov`i' = num_prov >= `i'
ivreghdfe numprov`i' $spec1
if `i' == 4 {
regsave using "num_prov.dta", table(numprov`i', format(%5.4f) parentheses(stderr) asterisk(10 5 1) order(regvars N R2)) replace
}
else {
regsave using "num_prov.dta", table(numprov`i', format(%5.4f) parentheses(stderr) asterisk(10 5 1) order(regvars N R2)) append
}
}

forval i = 4/7 {
cap gen numprov`i' = num_prov >= `i'
ivreghdfe numprov`i' $spec2 
if `i' == 4 {
regsave using "num_prov2.dta", table(numprov`i', format(%5.4f) parentheses(stderr) asterisk(10 5 1) order(regvars N R2)) replace
}
else {
regsave using "num_prov2.dta", table(numprov`i', format(%5.4f) parentheses(stderr) asterisk(10 5 1) order(regvars N R2)) append
}
}

